home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 April: Mac OS SDK / Dev.CD Apr 99 SDK1.toast / Development Kits / Interfaces&Libraries / Universal / Interfaces / PInterfaces / CMApplication.p < prev    next >
Encoding:
Text File  |  1998-08-17  |  40.4 KB  |  1,148 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        CMApplication.p
  3.  
  4.      Contains:    ColorSync API
  5.  
  6.      Version:    Technology:    ColorSync 2.5
  7.                  Release:    Universal Interfaces 3.2
  8.  
  9.      Copyright:    © 1992-1998 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. }
  17. {$IFC UNDEFINED UsingIncludes}
  18. {$SETC UsingIncludes := 0}
  19. {$ENDC}
  20.  
  21. {$IFC NOT UsingIncludes}
  22.  UNIT CMApplication;
  23.  INTERFACE
  24. {$ENDC}
  25.  
  26. {$IFC UNDEFINED __CMAPPLICATION__}
  27. {$SETC __CMAPPLICATION__ := 1}
  28.  
  29. {$I+}
  30. {$SETC CMApplicationIncludes := UsingIncludes}
  31. {$SETC UsingIncludes := 1}
  32.  
  33. {$IFC UNDEFINED __MACTYPES__}
  34. {$I MacTypes.p}
  35. {$ENDC}
  36. {$IFC UNDEFINED __QUICKDRAW__}
  37. {$I Quickdraw.p}
  38. {$ENDC}
  39. {$IFC UNDEFINED __FILES__}
  40. {$I Files.p}
  41. {$ENDC}
  42. {$IFC UNDEFINED __PRINTING__}
  43. {$I Printing.p}
  44. {$ENDC}
  45. {$IFC UNDEFINED __CMICCPROFILE__}
  46. {$I CMICCProfile.p}
  47. {$ENDC}
  48. {$IFC UNDEFINED __DISPLAYS__}
  49. {$I Displays.p}
  50. {$ENDC}
  51.  
  52.  
  53. {$PUSH}
  54. {$ALIGN MAC68K}
  55. {$LibExport+}
  56.  
  57.  
  58. CONST
  59.     kDefaultCMMSignature        = 'appl';
  60.  
  61. { Macintosh 68K trap word }
  62.     cmTrap                        = $ABEE;
  63.  
  64.  
  65. { PicComment IDs }
  66.     cmBeginProfile                = 220;
  67.     cmEndProfile                = 221;
  68.     cmEnableMatching            = 222;
  69.     cmDisableMatching            = 223;
  70.     cmComment                    = 224;
  71.  
  72. { PicComment selectors for cmComment }
  73.     cmBeginProfileSel            = 0;
  74.     cmContinueProfileSel        = 1;
  75.     cmEndProfileSel                = 2;
  76.     cmProfileIdentifierSel        = 3;
  77.  
  78.  
  79. { Defines for version 1.0 CMProfileSearchRecord.fieldMask }
  80.     cmMatchCMMType                = $00000001;
  81.     cmMatchApplProfileVersion    = $00000002;
  82.     cmMatchDataType                = $00000004;
  83.     cmMatchDeviceType            = $00000008;
  84.     cmMatchDeviceManufacturer    = $00000010;
  85.     cmMatchDeviceModel            = $00000020;
  86.     cmMatchDeviceAttributes        = $00000040;
  87.     cmMatchFlags                = $00000080;
  88.     cmMatchOptions                = $00000100;
  89.     cmMatchWhite                = $00000200;
  90.     cmMatchBlack                = $00000400;
  91.  
  92. { Defines for version 2.0 CMSearchRecord.searchMask }
  93.     cmMatchAnyProfile            = $00000000;
  94.     cmMatchProfileCMMType        = $00000001;
  95.     cmMatchProfileClass            = $00000002;
  96.     cmMatchDataColorSpace        = $00000004;
  97.     cmMatchProfileConnectionSpace = $00000008;
  98.     cmMatchManufacturer            = $00000010;
  99.     cmMatchModel                = $00000020;
  100.     cmMatchAttributes            = $00000040;
  101.     cmMatchProfileFlags            = $00000080;
  102.  
  103. { Result codes }
  104.                                                                 {  General Errors  }
  105.     cmProfileError                = -170;
  106.     cmMethodError                = -171;
  107.     cmMethodNotFound            = -175;                            {  CMM not present  }
  108.     cmProfileNotFound            = -176;                            {  Responder error  }
  109.     cmProfilesIdentical            = -177;                            {  Profiles the same  }
  110.     cmCantConcatenateError        = -178;                            {  Profile can't be concatenated  }
  111.     cmCantXYZ                    = -179;                            {  CMM cant handle XYZ space  }
  112.     cmCantDeleteProfile            = -180;                            {  Responder error  }
  113.     cmUnsupportedDataType        = -181;                            {  Responder error  }
  114.     cmNoCurrentProfile            = -182;                            {  Responder error  }
  115.                                                                 {  Profile Access Errors  }
  116.     cmElementTagNotFound        = -4200;
  117.     cmIndexRangeErr                = -4201;                        {  Tag index out of range  }
  118.     cmCantDeleteElement            = -4202;
  119.     cmFatalProfileErr            = -4203;
  120.     cmInvalidProfile            = -4204;                        {  A Profile must contain a 'cs1 ' tag to be valid  }
  121.     cmInvalidProfileLocation    = -4205;                        {  Operation not supported for this profile location  }
  122.     cmCantCopyModifiedV1Profile    = -4215;                        {  Illegal to copy version 1 profiles that have been modified  }
  123.                                                                 {  Profile Search Errors  }
  124.     cmInvalidSearch                = -4206;                        {  Bad Search Handle  }
  125.     cmSearchError                = -4207;
  126.     cmErrIncompatibleProfile    = -4208;                        {  Other ColorSync Errors  }
  127.     cmInvalidColorSpace            = -4209;                        {  Profile colorspace does not match bitmap type  }
  128.     cmInvalidSrcMap                = -4210;                        {  Source pix/bit map was invalid  }
  129.     cmInvalidDstMap                = -4211;                        {  Destination pix/bit map was invalid  }
  130.     cmNoGDevicesError            = -4212;                        {  Begin/End Matching -- no gdevices available  }
  131.     cmInvalidProfileComment        = -4213;                        {  Bad Profile comment during drawpicture  }
  132.     cmRangeOverFlow                = -4214;                        {  Color conversion warning that some output color values over/underflowed and were clipped  }
  133.     cmNamedColorNotFound        = -4216;                        {  NamedColor not found  }
  134.     cmCantGamutCheckError        = -4217;                        {  Gammut checking not supported by this ColorWorld  }
  135.  
  136. { deviceType values for ColorSync 1.0 Device Profile access }
  137.     cmSystemDevice                = 'sys ';
  138.     cmGDevice                    = 'gdev';
  139.  
  140. { Commands for CMFlattenUPP(…) }
  141.     cmOpenReadSpool                = 1;
  142.     cmOpenWriteSpool            = 2;
  143.     cmReadSpool                    = 3;
  144.     cmWriteSpool                = 4;
  145.     cmCloseSpool                = 5;
  146.  
  147. { Flags for PostScript-related functions }
  148.     cmPS7bit                    = 1;
  149.     cmPS8bit                    = 2;
  150.  
  151. { Flags for profile embedding functions }
  152.     cmEmbedWholeProfile            = $00000000;
  153.     cmEmbedProfileIdentifier    = $00000001;
  154.  
  155. { Commands for CMAccessUPP(…) }
  156.     cmOpenReadAccess            = 1;
  157.     cmOpenWriteAccess            = 2;
  158.     cmReadAccess                = 3;
  159.     cmWriteAccess                = 4;
  160.     cmCloseAccess                = 5;
  161.     cmCreateNewAccess            = 6;
  162.     cmAbortWriteAccess            = 7;
  163.     cmBeginAccess                = 8;
  164.     cmEndAccess                    = 9;
  165.  
  166.  
  167. { Abstract data type for memory-based Profile }
  168.  
  169. TYPE
  170.     CMProfileRef = ^LONGINT;
  171. { Abstract data type for Profile search result }
  172.     CMProfileSearchRef = ^LONGINT;
  173. { Abstract data type for BeginMatching(…) reference }
  174.     CMMatchRef = ^LONGINT;
  175. { Abstract data type for ColorWorld reference }
  176.     CMWorldRef = ^LONGINT;
  177. { Caller-supplied flatten function }
  178. {$IFC TYPED_FUNCTION_POINTERS}
  179.     CMFlattenProcPtr = FUNCTION(command: LONGINT; VAR size: LONGINT; data: UNIV Ptr; refCon: UNIV Ptr): OSErr;
  180. {$ELSEC}
  181.     CMFlattenProcPtr = ProcPtr;
  182. {$ENDC}
  183.  
  184. { Caller-supplied progress function for Bitmap & PixMap matching routines }
  185. {$IFC TYPED_FUNCTION_POINTERS}
  186.     CMBitmapCallBackProcPtr = FUNCTION(progress: LONGINT; refCon: UNIV Ptr): BOOLEAN;
  187. {$ELSEC}
  188.     CMBitmapCallBackProcPtr = ProcPtr;
  189. {$ENDC}
  190.  
  191. { Caller-supplied filter function for Profile search }
  192. {$IFC TYPED_FUNCTION_POINTERS}
  193.     CMProfileFilterProcPtr = FUNCTION(prof: CMProfileRef; refCon: UNIV Ptr): BOOLEAN;
  194. {$ELSEC}
  195.     CMProfileFilterProcPtr = ProcPtr;
  196. {$ENDC}
  197.  
  198. { Caller-supplied function for profile access }
  199. {$IFC TYPED_FUNCTION_POINTERS}
  200.     CMProfileAccessProcPtr = FUNCTION(command: LONGINT; offset: LONGINT; VAR size: LONGINT; data: UNIV Ptr; refCon: UNIV Ptr): OSErr;
  201. {$ELSEC}
  202.     CMProfileAccessProcPtr = ProcPtr;
  203. {$ENDC}
  204.  
  205.     CMFlattenUPP = UniversalProcPtr;
  206.     CMBitmapCallBackUPP = UniversalProcPtr;
  207.     CMProfileFilterUPP = UniversalProcPtr;
  208.     CMProfileAccessUPP = UniversalProcPtr;
  209.  
  210. CONST
  211.     uppCMFlattenProcInfo = $00003FE0;
  212.     uppCMBitmapCallBackProcInfo = $000003D0;
  213.     uppCMProfileFilterProcInfo = $000003D0;
  214.     uppCMProfileAccessProcInfo = $0000FFE0;
  215.  
  216. FUNCTION NewCMFlattenProc(userRoutine: CMFlattenProcPtr): CMFlattenUPP;
  217.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  218.     INLINE $2E9F;
  219.     {$ENDC}
  220.  
  221. FUNCTION NewCMBitmapCallBackProc(userRoutine: CMBitmapCallBackProcPtr): CMBitmapCallBackUPP;
  222.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  223.     INLINE $2E9F;
  224.     {$ENDC}
  225.  
  226. FUNCTION NewCMProfileFilterProc(userRoutine: CMProfileFilterProcPtr): CMProfileFilterUPP;
  227.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  228.     INLINE $2E9F;
  229.     {$ENDC}
  230.  
  231. FUNCTION NewCMProfileAccessProc(userRoutine: CMProfileAccessProcPtr): CMProfileAccessUPP;
  232.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  233.     INLINE $2E9F;
  234.     {$ENDC}
  235.  
  236. FUNCTION CallCMFlattenProc(command: LONGINT; VAR size: LONGINT; data: UNIV Ptr; refCon: UNIV Ptr; userRoutine: CMFlattenUPP): OSErr;
  237.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  238.     INLINE $205F, $4E90;
  239.     {$ENDC}
  240.  
  241. FUNCTION CallCMBitmapCallBackProc(progress: LONGINT; refCon: UNIV Ptr; userRoutine: CMBitmapCallBackUPP): BOOLEAN;
  242.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  243.     INLINE $205F, $4E90;
  244.     {$ENDC}
  245.  
  246. FUNCTION CallCMProfileFilterProc(prof: CMProfileRef; refCon: UNIV Ptr; userRoutine: CMProfileFilterUPP): BOOLEAN;
  247.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  248.     INLINE $205F, $4E90;
  249.     {$ENDC}
  250.  
  251. FUNCTION CallCMProfileAccessProc(command: LONGINT; offset: LONGINT; VAR size: LONGINT; data: UNIV Ptr; refCon: UNIV Ptr; userRoutine: CMProfileAccessUPP): OSErr;
  252.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  253.     INLINE $205F, $4E90;
  254.     {$ENDC}
  255.  
  256. TYPE
  257.     CMError                                = LONGINT;
  258. { For 1.0 and 2.0 profile header variants }
  259. { CMAppleProfileHeader }
  260.     CMAppleProfileHeaderPtr = ^CMAppleProfileHeader;
  261.     CMAppleProfileHeader = RECORD
  262.         CASE INTEGER OF
  263.         0: (
  264.             cm1:                CMHeader;
  265.             );
  266.         1: (
  267.             cm2:                CM2Header;
  268.             );
  269.     END;
  270.  
  271. { Param for CWConcatColorWorld(…) }
  272.     CMConcatProfileSetPtr = ^CMConcatProfileSet;
  273.     CMConcatProfileSet = RECORD
  274.         keyIndex:                UInt16;                                    {  Zero-based  }
  275.         count:                    UInt16;                                    {  Min 1  }
  276.         profileSet:                ARRAY [0..0] OF CMProfileRef;            {  Variable. Ordered from Source -> Dest  }
  277.     END;
  278.  
  279. { ColorSync color data types }
  280.     CMRGBColorPtr = ^CMRGBColor;
  281.     CMRGBColor = RECORD
  282.         red:                    UInt16;                                    {  0..65535  }
  283.         green:                    UInt16;
  284.         blue:                    UInt16;
  285.     END;
  286.  
  287.     CMCMYKColorPtr = ^CMCMYKColor;
  288.     CMCMYKColor = RECORD
  289.         cyan:                    UInt16;                                    {  0..65535  }
  290.         magenta:                UInt16;
  291.         yellow:                    UInt16;
  292.         black:                    UInt16;
  293.     END;
  294.  
  295.     CMCMYColorPtr = ^CMCMYColor;
  296.     CMCMYColor = RECORD
  297.         cyan:                    UInt16;                                    {  0..65535  }
  298.         magenta:                UInt16;
  299.         yellow:                    UInt16;
  300.     END;
  301.  
  302.     CMHLSColorPtr = ^CMHLSColor;
  303.     CMHLSColor = RECORD
  304.         hue:                    UInt16;                                    {  0..65535. Fraction of circle. Red at 0  }
  305.         lightness:                UInt16;                                    {  0..65535  }
  306.         saturation:                UInt16;                                    {  0..65535  }
  307.     END;
  308.  
  309.     CMHSVColorPtr = ^CMHSVColor;
  310.     CMHSVColor = RECORD
  311.         hue:                    UInt16;                                    {  0..65535. Fraction of circle. Red at 0  }
  312.         saturation:                UInt16;                                    {  0..65535  }
  313.         value:                    UInt16;                                    {  0..65535  }
  314.     END;
  315.  
  316.     CMLabColorPtr = ^CMLabColor;
  317.     CMLabColor = RECORD
  318.         L:                        UInt16;                                    {  0..65535 maps to 0..100  }
  319.         a:                        UInt16;                                    {  0..65535 maps to -128..127.996  }
  320.         b:                        UInt16;                                    {  0..65535 maps to -128..127.996  }
  321.     END;
  322.  
  323.     CMLuvColorPtr = ^CMLuvColor;
  324.     CMLuvColor = RECORD
  325.         L:                        UInt16;                                    {  0..65535 maps to 0..100  }
  326.         u:                        UInt16;                                    {  0..65535 maps to -128..127.996  }
  327.         v:                        UInt16;                                    {  0..65535 maps to -128..127.996  }
  328.     END;
  329.  
  330.     CMYxyColorPtr = ^CMYxyColor;
  331.     CMYxyColor = RECORD
  332.         capY:                    UInt16;                                    {  0..65535 maps to 0..1  }
  333.         x:                        UInt16;                                    {  0..65535 maps to 0..1  }
  334.         y:                        UInt16;                                    {  0..65535 maps to 0..1  }
  335.     END;
  336.  
  337.     CMGrayColorPtr = ^CMGrayColor;
  338.     CMGrayColor = RECORD
  339.         gray:                    UInt16;                                    {  0..65535  }
  340.     END;
  341.  
  342.     CMMultichannel5ColorPtr = ^CMMultichannel5Color;
  343.     CMMultichannel5Color = RECORD
  344.         components:                PACKED ARRAY [0..4] OF UInt8;            {  0..255  }
  345.     END;
  346.  
  347.     CMMultichannel6ColorPtr = ^CMMultichannel6Color;
  348.     CMMultichannel6Color = RECORD
  349.         components:                PACKED ARRAY [0..5] OF UInt8;            {  0..255  }
  350.     END;
  351.  
  352.     CMMultichannel7ColorPtr = ^CMMultichannel7Color;
  353.     CMMultichannel7Color = RECORD
  354.         components:                PACKED ARRAY [0..6] OF UInt8;            {  0..255  }
  355.     END;
  356.  
  357.     CMMultichannel8ColorPtr = ^CMMultichannel8Color;
  358.     CMMultichannel8Color = RECORD
  359.         components:                PACKED ARRAY [0..7] OF UInt8;            {  0..255  }
  360.     END;
  361.  
  362.     CMNamedColorPtr = ^CMNamedColor;
  363.     CMNamedColor = RECORD
  364.         namedColorIndex:        UInt32;                                    {  0..a lot  }
  365.     END;
  366.  
  367.     CMColorPtr = ^CMColor;
  368.     CMColor = RECORD
  369.         CASE INTEGER OF
  370.         0: (
  371.             rgb:                CMRGBColor;
  372.             );
  373.         1: (
  374.             hsv:                CMHSVColor;
  375.             );
  376.         2: (
  377.             hls:                CMHLSColor;
  378.             );
  379.         3: (
  380.             XYZ:                CMXYZColor;
  381.             );
  382.         4: (
  383.             Lab:                CMLabColor;
  384.             );
  385.         5: (
  386.             Luv:                CMLuvColor;
  387.             );
  388.         6: (
  389.             Yxy:                CMYxyColor;
  390.             );
  391.         7: (
  392.             cmyk:                CMCMYKColor;
  393.             );
  394.         8: (
  395.             cmy:                CMCMYColor;
  396.             );
  397.         9: (
  398.             gray:                CMGrayColor;
  399.             );
  400.         10: (
  401.             mc5:                CMMultichannel5Color;
  402.             );
  403.         11: (
  404.             mc6:                CMMultichannel6Color;
  405.             );
  406.         12: (
  407.             mc7:                CMMultichannel7Color;
  408.             );
  409.         13: (
  410.             mc8:                CMMultichannel8Color;
  411.             );
  412.         14: (
  413.             namedColor:            CMNamedColor;
  414.             );
  415.     END;
  416.  
  417.     CMProfileSearchRecordPtr = ^CMProfileSearchRecord;
  418.     CMProfileSearchRecord = RECORD
  419.         header:                    CMHeader;
  420.         fieldMask:                UInt32;
  421.         reserved:                ARRAY [0..1] OF UInt32;
  422.     END;
  423.  
  424.     CMProfileSearchRecordHandle            = ^CMProfileSearchRecordPtr;
  425. { Search definition for 2.0 }
  426.     CMSearchRecordPtr = ^CMSearchRecord;
  427.     CMSearchRecord = RECORD
  428.         CMMType:                OSType;
  429.         profileClass:            OSType;
  430.         dataColorSpace:            OSType;
  431.         profileConnectionSpace:    OSType;
  432.         deviceManufacturer:        UInt32;
  433.         deviceModel:            UInt32;
  434.         deviceAttributes:        ARRAY [0..1] OF UInt32;
  435.         profileFlags:            UInt32;
  436.         searchMask:                UInt32;
  437.         filter:                    CMProfileFilterUPP;
  438.     END;
  439.  
  440. { GetCWInfo structures }
  441.     CMMInfoRecordPtr = ^CMMInfoRecord;
  442.     CMMInfoRecord = RECORD
  443.         CMMType:                OSType;
  444.         CMMVersion:                LONGINT;
  445.     END;
  446.  
  447.     CMCWInfoRecordPtr = ^CMCWInfoRecord;
  448.     CMCWInfoRecord = RECORD
  449.         cmmCount:                UInt32;
  450.         cmmInfo:                ARRAY [0..1] OF CMMInfoRecord;
  451.     END;
  452.  
  453. { profile identifier structures }
  454.     CMProfileIdentifierPtr = ^CMProfileIdentifier;
  455.     CMProfileIdentifier = RECORD
  456.         profileHeader:            CM2Header;
  457.         calibrationDate:        CMDateTime;
  458.         ASCIIProfileDescriptionLen: UInt32;
  459.         ASCIIProfileDescription: SInt8;                                    {  variable length  }
  460.     END;
  461.  
  462. { packing formats }
  463.  
  464. CONST
  465.     cmNoColorPacking            = $0000;
  466.     cmAlphaSpace                = $0080;
  467.     cmWord5ColorPacking            = $0500;
  468.     cmLong8ColorPacking            = $0800;
  469.     cmLong10ColorPacking        = $0A00;
  470.     cmAlphaFirstPacking            = $1000;
  471.     cmOneBitDirectPacking        = $0B00;
  472.     cmAlphaLastPacking            = $0000;
  473.     cm24_8ColorPacking            = $2100;
  474.     cm32_8ColorPacking            = $0800;
  475.     cm40_8ColorPacking            = $2200;
  476.     cm48_8ColorPacking            = $2300;
  477.     cm56_8ColorPacking            = $2400;
  478.     cm64_8ColorPacking            = $2500;
  479.     cm32_16ColorPacking            = $2600;
  480.     cm48_16ColorPacking            = $2900;
  481.     cm64_16ColorPacking            = $2A00;
  482.     cm32_32ColorPacking            = $2700;
  483.  
  484. { general colorspaces }
  485.     cmNoSpace                    = 0;
  486.     cmRGBSpace                    = 1;
  487.     cmCMYKSpace                    = 2;
  488.     cmHSVSpace                    = 3;
  489.     cmHLSSpace                    = 4;
  490.     cmYXYSpace                    = 5;
  491.     cmXYZSpace                    = 6;
  492.     cmLUVSpace                    = 7;
  493.     cmLABSpace                    = 8;
  494.     cmReservedSpace1            = 9;
  495.     cmGraySpace                    = 10;
  496.     cmReservedSpace2            = 11;
  497.     cmGamutResultSpace            = 12;
  498.     cmNamedIndexedSpace            = 16;
  499.     cmMCFiveSpace                = 17;
  500.     cmMCSixSpace                = 18;
  501.     cmMCSevenSpace                = 19;
  502.     cmMCEightSpace                = 20;
  503.     cmRGBASpace                    = 129;
  504.     cmGrayASpace                = 138;
  505.  
  506. { supported CMBitmapColorSpaces - each of the following is a }
  507. { combination of a general colospace and a packing formats }
  508.     cmGray16Space                = 10;
  509.     cmGrayA32Space                = 138;
  510.     cmRGB16Space                = $0501;
  511.     cmRGB24Space                = $2101;
  512.     cmRGB32Space                = $0801;
  513.     cmRGB48Space                = $2901;
  514.     cmARGB32Space                = $1881;
  515.     cmRGBA32Space                = $0881;
  516.     cmCMYK32Space                = $0802;
  517.     cmCMYK64Space                = $2A02;
  518.     cmHSV32Space                = $0A03;
  519.     cmHLS32Space                = $0A04;
  520.     cmYXY32Space                = $0A05;
  521.     cmXYZ32Space                = $0A06;
  522.     cmLUV32Space                = $0A07;
  523.     cmLAB24Space                = $2108;
  524.     cmLAB32Space                = $0A08;
  525.     cmLAB48Space                = $2908;
  526.     cmGamutResult1Space            = $0B0C;
  527.     cmNamedIndexed32Space        = $2710;
  528.     cmMCFive8Space                = $2211;
  529.     cmMCSix8Space                = $2312;
  530.     cmMCSeven8Space                = $2413;
  531.     cmMCEight8Space                = $2514;
  532.  
  533.  
  534.  
  535. TYPE
  536.     CMBitmapColorSpace                    = UInt32;
  537.     CMBitmapPtr = ^CMBitmap;
  538.     CMBitmap = RECORD
  539.         image:                    CStringPtr;
  540.         width:                    LONGINT;
  541.         height:                    LONGINT;
  542.         rowBytes:                LONGINT;
  543.         pixelSize:                LONGINT;
  544.         space:                    CMBitmapColorSpace;
  545.         user1:                    LONGINT;
  546.         user2:                    LONGINT;
  547.     END;
  548.  
  549.  
  550. { Classic Print Manager Stuff }
  551.  
  552. CONST
  553.     enableColorMatchingOp        = 12;
  554.     registerProfileOp            = 13;
  555.  
  556.     cmNoProfileBase                = 0;
  557.     cmFileBasedProfile            = 1;
  558.     cmHandleBasedProfile        = 2;
  559.     cmPtrBasedProfile            = 3;
  560.     cmProcedureBasedProfile        = 4;
  561.  
  562.  
  563. TYPE
  564.     CMFileLocationPtr = ^CMFileLocation;
  565.     CMFileLocation = RECORD
  566.         spec:                    FSSpec;
  567.     END;
  568.  
  569.     CMHandleLocationPtr = ^CMHandleLocation;
  570.     CMHandleLocation = RECORD
  571.         h:                        Handle;
  572.     END;
  573.  
  574.     CMPtrLocationPtr = ^CMPtrLocation;
  575.     CMPtrLocation = RECORD
  576.         p:                        Ptr;
  577.     END;
  578.  
  579.     CMProcedureLocationPtr = ^CMProcedureLocation;
  580.     CMProcedureLocation = RECORD
  581.         proc:                    CMProfileAccessUPP;
  582.         refCon:                    Ptr;
  583.     END;
  584.  
  585.  
  586.     CMProfLocPtr = ^CMProfLoc;
  587.     CMProfLoc = RECORD
  588.         CASE INTEGER OF
  589.         0: (
  590.             fileLoc:            CMFileLocation;
  591.             );
  592.         1: (
  593.             handleLoc:            CMHandleLocation;
  594.             );
  595.         2: (
  596.             ptrLoc:                CMPtrLocation;
  597.             );
  598.         3: (
  599.             procLoc:            CMProcedureLocation;
  600.             );
  601.     END;
  602.  
  603.     CMProfileLocationPtr = ^CMProfileLocation;
  604.     CMProfileLocation = RECORD
  605.         locType:                INTEGER;
  606.         u:                        CMProfLoc;
  607.     END;
  608.  
  609.  
  610. CONST
  611.     cmOriginalProfileLocationSize = 72;
  612.     cmCurrentProfileLocationSize = 72;
  613.  
  614.  
  615. { Struct and enums used for Profile iteration }
  616.     cmProfileIterateDataVersion1 = $00010000;
  617.  
  618.  
  619. TYPE
  620.     CMProfileIterateDataPtr = ^CMProfileIterateData;
  621.     CMProfileIterateData = RECORD
  622.         dataVersion:            UInt32;                                    {  cmProfileIterateDataVersion1  }
  623.         header:                    CM2Header;
  624.         code:                    ScriptCode;
  625.         name:                    Str255;
  626.         location:                CMProfileLocation;
  627.     END;
  628.  
  629. { Caller-supplied callback function for Profile iteration }
  630. {$IFC TYPED_FUNCTION_POINTERS}
  631.     CMProfileIterateProcPtr = FUNCTION(VAR iterateData: CMProfileIterateData; refCon: UNIV Ptr): OSErr;
  632. {$ELSEC}
  633.     CMProfileIterateProcPtr = ProcPtr;
  634. {$ENDC}
  635.  
  636.     CMProfileIterateUPP = UniversalProcPtr;
  637.  
  638. CONST
  639.     uppCMProfileIterateProcInfo = $000003E0;
  640.  
  641. FUNCTION NewCMProfileIterateProc(userRoutine: CMProfileIterateProcPtr): CMProfileIterateUPP;
  642.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  643.     INLINE $2E9F;
  644.     {$ENDC}
  645.  
  646. FUNCTION CallCMProfileIterateProc(VAR iterateData: CMProfileIterateData; refCon: UNIV Ptr; userRoutine: CMProfileIterateUPP): OSErr;
  647.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  648.     INLINE $205F, $4E90;
  649.     {$ENDC}
  650. { Profile file and element access }
  651. FUNCTION CMNewProfile(VAR prof: CMProfileRef; {CONST}VAR theProfile: CMProfileLocation): CMError;
  652.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  653.     INLINE $203C, $0008, $001B, $ABEE;
  654.     {$ENDC}
  655. FUNCTION CMOpenProfile(VAR prof: CMProfileRef; {CONST}VAR theProfile: CMProfileLocation): CMError;
  656.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  657.     INLINE $203C, $0008, $001C, $ABEE;
  658.     {$ENDC}
  659. FUNCTION CMCloseProfile(prof: CMProfileRef): CMError;
  660.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  661.     INLINE $203C, $0004, $001D, $ABEE;
  662.     {$ENDC}
  663. FUNCTION CMUpdateProfile(prof: CMProfileRef): CMError;
  664.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  665.     INLINE $203C, $0004, $0034, $ABEE;
  666.     {$ENDC}
  667. FUNCTION CMCopyProfile(VAR targetProf: CMProfileRef; {CONST}VAR targetLocation: CMProfileLocation; srcProf: CMProfileRef): CMError;
  668.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  669.     INLINE $203C, $000C, $0025, $ABEE;
  670.     {$ENDC}
  671. FUNCTION CMValidateProfile(prof: CMProfileRef; VAR valid: BOOLEAN; VAR preferredCMMnotfound: BOOLEAN): CMError;
  672.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  673.     INLINE $203C, $000C, $0026, $ABEE;
  674.     {$ENDC}
  675. FUNCTION CMGetProfileLocation(prof: CMProfileRef; VAR theProfile: CMProfileLocation): CMError;
  676.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  677.     INLINE $203C, $0008, $003C, $ABEE;
  678.     {$ENDC}
  679. FUNCTION NCMGetProfileLocation(prof: CMProfileRef; VAR theProfile: CMProfileLocation; VAR locationSize: UInt32): CMError;
  680.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  681.     INLINE $203C, $000C, $0059, $ABEE;
  682.     {$ENDC}
  683. FUNCTION CMFlattenProfile(prof: CMProfileRef; flags: UInt32; proc: CMFlattenUPP; refCon: UNIV Ptr; VAR preferredCMMnotfound: BOOLEAN): CMError;
  684.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  685.     INLINE $203C, $0014, $0031, $ABEE;
  686.     {$ENDC}
  687. FUNCTION CMUnflattenProfile(VAR resultFileSpec: FSSpec; proc: CMFlattenUPP; refCon: UNIV Ptr; VAR preferredCMMnotfound: BOOLEAN): CMError;
  688.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  689.     INLINE $203C, $0010, $0032, $ABEE;
  690.     {$ENDC}
  691. FUNCTION CMGetProfileHeader(prof: CMProfileRef; VAR header: CMAppleProfileHeader): CMError;
  692.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  693.     INLINE $203C, $0008, $0039, $ABEE;
  694.     {$ENDC}
  695. FUNCTION CMSetProfileHeader(prof: CMProfileRef; {CONST}VAR header: CMAppleProfileHeader): CMError;
  696.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  697.     INLINE $203C, $0008, $003A, $ABEE;
  698.     {$ENDC}
  699. FUNCTION CMProfileElementExists(prof: CMProfileRef; tag: OSType; VAR found: BOOLEAN): CMError;
  700.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  701.     INLINE $203C, $000C, $001E, $ABEE;
  702.     {$ENDC}
  703. FUNCTION CMCountProfileElements(prof: CMProfileRef; VAR elementCount: UInt32): CMError;
  704.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  705.     INLINE $203C, $0008, $001F, $ABEE;
  706.     {$ENDC}
  707. FUNCTION CMGetProfileElement(prof: CMProfileRef; tag: OSType; VAR elementSize: UInt32; elementData: UNIV Ptr): CMError;
  708.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  709.     INLINE $203C, $0010, $0020, $ABEE;
  710.     {$ENDC}
  711. FUNCTION CMSetProfileElement(prof: CMProfileRef; tag: OSType; elementSize: UInt32; elementData: UNIV Ptr): CMError;
  712.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  713.     INLINE $203C, $0010, $0023, $ABEE;
  714.     {$ENDC}
  715. FUNCTION CMSetProfileElementSize(prof: CMProfileRef; tag: OSType; elementSize: UInt32): CMError;
  716.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  717.     INLINE $203C, $000C, $0038, $ABEE;
  718.     {$ENDC}
  719. FUNCTION CMSetProfileElementReference(prof: CMProfileRef; elementTag: OSType; referenceTag: OSType): CMError;
  720.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  721.     INLINE $203C, $000C, $0035, $ABEE;
  722.     {$ENDC}
  723. FUNCTION CMGetPartialProfileElement(prof: CMProfileRef; tag: OSType; offset: UInt32; VAR byteCount: UInt32; elementData: UNIV Ptr): CMError;
  724.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  725.     INLINE $203C, $0014, $0036, $ABEE;
  726.     {$ENDC}
  727. FUNCTION CMSetPartialProfileElement(prof: CMProfileRef; tag: OSType; offset: UInt32; byteCount: UInt32; elementData: UNIV Ptr): CMError;
  728.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  729.     INLINE $203C, $0014, $0037, $ABEE;
  730.     {$ENDC}
  731. FUNCTION CMGetIndProfileElementInfo(prof: CMProfileRef; index: UInt32; VAR tag: OSType; VAR elementSize: UInt32; VAR refs: BOOLEAN): CMError;
  732.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  733.     INLINE $203C, $0014, $0021, $ABEE;
  734.     {$ENDC}
  735. FUNCTION CMGetIndProfileElement(prof: CMProfileRef; index: UInt32; VAR elementSize: UInt32; elementData: UNIV Ptr): CMError;
  736.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  737.     INLINE $203C, $0010, $0022, $ABEE;
  738.     {$ENDC}
  739. FUNCTION CMRemoveProfileElement(prof: CMProfileRef; tag: OSType): CMError;
  740.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  741.     INLINE $203C, $0008, $0024, $ABEE;
  742.     {$ENDC}
  743. FUNCTION CMGetScriptProfileDescription(prof: CMProfileRef; VAR name: Str255; VAR code: ScriptCode): CMError;
  744.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  745.     INLINE $203C, $000C, $003E, $ABEE;
  746.     {$ENDC}
  747. FUNCTION CMCloneProfileRef(prof: CMProfileRef): CMError;
  748.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  749.     INLINE $203C, $0004, $0042, $ABEE;
  750.     {$ENDC}
  751. FUNCTION CMGetProfileRefCount(prof: CMProfileRef; VAR count: LONGINT): CMError;
  752.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  753.     INLINE $203C, $0008, $0043, $ABEE;
  754.     {$ENDC}
  755. FUNCTION CMProfileModified(prof: CMProfileRef; VAR modified: BOOLEAN): CMError;
  756.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  757.     INLINE $203C, $0008, $0044, $ABEE;
  758.     {$ENDC}
  759.  
  760. { named Color access functions }
  761. FUNCTION CMGetNamedColorInfo(prof: CMProfileRef; VAR deviceChannels: UInt32; VAR deviceColorSpace: OSType; VAR PCSColorSpace: OSType; VAR count: UInt32; prefix: StringPtr; suffix: StringPtr): CMError;
  762.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  763.     INLINE $203C, $001C, $0046, $ABEE;
  764.     {$ENDC}
  765. FUNCTION CMGetNamedColorValue(prof: CMProfileRef; name: StringPtr; VAR deviceColor: CMColor; VAR PCSColor: CMColor): CMError;
  766.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  767.     INLINE $203C, $0010, $0047, $ABEE;
  768.     {$ENDC}
  769. FUNCTION CMGetIndNamedColorValue(prof: CMProfileRef; index: UInt32; VAR deviceColor: CMColor; VAR PCSColor: CMColor): CMError;
  770.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  771.     INLINE $203C, $0010, $0048, $ABEE;
  772.     {$ENDC}
  773. FUNCTION CMGetNamedColorIndex(prof: CMProfileRef; name: StringPtr; VAR index: UInt32): CMError;
  774.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  775.     INLINE $203C, $000C, $0049, $ABEE;
  776.     {$ENDC}
  777. FUNCTION CMGetNamedColorName(prof: CMProfileRef; index: UInt32; name: StringPtr): CMError;
  778.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  779.     INLINE $203C, $000C, $004A, $ABEE;
  780.     {$ENDC}
  781.  
  782. { Low-level matching functions }
  783. FUNCTION NCWNewColorWorld(VAR cw: CMWorldRef; src: CMProfileRef; dst: CMProfileRef): CMError;
  784.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  785.     INLINE $203C, $000C, $0014, $ABEE;
  786.     {$ENDC}
  787. FUNCTION CWConcatColorWorld(VAR cw: CMWorldRef; VAR profileSet: CMConcatProfileSet): CMError;
  788.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  789.     INLINE $203C, $0008, $0015, $ABEE;
  790.     {$ENDC}
  791. FUNCTION CWNewLinkProfile(VAR prof: CMProfileRef; {CONST}VAR targetLocation: CMProfileLocation; VAR profileSet: CMConcatProfileSet): CMError;
  792.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  793.     INLINE $203C, $000C, $0033, $ABEE;
  794.     {$ENDC}
  795. PROCEDURE CWDisposeColorWorld(cw: CMWorldRef);
  796.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  797.     INLINE $203C, $0004, $0001, $ABEE;
  798.     {$ENDC}
  799. FUNCTION CWMatchColors(cw: CMWorldRef; VAR myColors: CMColor; count: UInt32): CMError;
  800.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  801.     INLINE $203C, $000C, $0002, $ABEE;
  802.     {$ENDC}
  803. FUNCTION CWCheckColors(cw: CMWorldRef; VAR myColors: CMColor; count: UInt32; VAR result: LONGINT): CMError;
  804.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  805.     INLINE $203C, $0010, $0003, $ABEE;
  806.     {$ENDC}
  807.  
  808. { Bitmap matching }
  809. FUNCTION CWMatchBitmap(cw: CMWorldRef; VAR bitmap: CMBitmap; progressProc: CMBitmapCallBackUPP; refCon: UNIV Ptr; VAR matchedBitmap: CMBitmap): CMError;
  810.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  811.     INLINE $203C, $0010, $002C, $ABEE;
  812.     {$ENDC}
  813. FUNCTION CWCheckBitmap(cw: CMWorldRef; {CONST}VAR bitmap: CMBitmap; progressProc: CMBitmapCallBackUPP; refCon: UNIV Ptr; VAR resultBitmap: CMBitmap): CMError;
  814.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  815.     INLINE $203C, $0014, $002D, $ABEE;
  816.     {$ENDC}
  817.  
  818. { Quickdraw-specific matching }
  819. FUNCTION CWMatchPixMap(cw: CMWorldRef; VAR myPixMap: PixMap; progressProc: CMBitmapCallBackUPP; refCon: UNIV Ptr): CMError;
  820.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  821.     INLINE $203C, $0010, $0004, $ABEE;
  822.     {$ENDC}
  823. FUNCTION CWCheckPixMap(cw: CMWorldRef; VAR myPixMap: PixMap; progressProc: CMBitmapCallBackUPP; refCon: UNIV Ptr; VAR resultBitMap: BitMap): CMError;
  824.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  825.     INLINE $203C, $0014, $0007, $ABEE;
  826.     {$ENDC}
  827. FUNCTION NCMBeginMatching(src: CMProfileRef; dst: CMProfileRef; VAR myRef: CMMatchRef): CMError;
  828.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  829.     INLINE $203C, $000C, $0016, $ABEE;
  830.     {$ENDC}
  831. PROCEDURE CMEndMatching(myRef: CMMatchRef);
  832.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  833.     INLINE $203C, $0004, $000B, $ABEE;
  834.     {$ENDC}
  835. PROCEDURE NCMDrawMatchedPicture(myPicture: PicHandle; dst: CMProfileRef; VAR myRect: Rect);
  836.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  837.     INLINE $203C, $000C, $0017, $ABEE;
  838.     {$ENDC}
  839. PROCEDURE CMEnableMatchingComment(enableIt: BOOLEAN);
  840.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  841.     INLINE $203C, $0002, $000D, $ABEE;
  842.     {$ENDC}
  843. FUNCTION NCMUseProfileComment(prof: CMProfileRef; flags: UInt32): CMError;
  844.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  845.     INLINE $203C, $0008, $003B, $ABEE;
  846.     {$ENDC}
  847. FUNCTION CMCreateProfileIdentifier(prof: CMProfileRef; ident: CMProfileIdentifierPtr; VAR size: UInt32): CMError;
  848.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  849.     INLINE $203C, $000C, $0041, $ABEE;
  850.     {$ENDC}
  851.  
  852. { System Profile access }
  853. FUNCTION CMGetSystemProfile(VAR prof: CMProfileRef): CMError;
  854.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  855.     INLINE $203C, $0004, $0018, $ABEE;
  856.     {$ENDC}
  857. FUNCTION CMSetSystemProfile({CONST}VAR profileFileSpec: FSSpec): CMError;
  858.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  859.     INLINE $203C, $0004, $0019, $ABEE;
  860.     {$ENDC}
  861. FUNCTION CMGetDefaultProfileBySpace(dataColorSpace: OSType; VAR prof: CMProfileRef): CMError;
  862.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  863.     INLINE $203C, $0008, $005A, $ABEE;
  864.     {$ENDC}
  865. FUNCTION CMSetDefaultProfileBySpace(dataColorSpace: OSType; prof: CMProfileRef): CMError;
  866.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  867.     INLINE $203C, $0008, $005B, $ABEE;
  868.     {$ENDC}
  869. FUNCTION CMGetProfileByAVID(theAVID: AVIDType; VAR prof: CMProfileRef): CMError;
  870.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  871.     INLINE $203C, $0008, $005C, $ABEE;
  872.     {$ENDC}
  873. FUNCTION CMSetProfileByAVID(theAVID: AVIDType; prof: CMProfileRef): CMError;
  874.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  875.     INLINE $203C, $0008, $005D, $ABEE;
  876.     {$ENDC}
  877.  
  878. { External Profile Management }
  879. FUNCTION CMNewProfileSearch(VAR searchSpec: CMSearchRecord; refCon: UNIV Ptr; VAR count: UInt32; VAR searchResult: CMProfileSearchRef): CMError;
  880.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  881.     INLINE $203C, $0010, $0027, $ABEE;
  882.     {$ENDC}
  883. FUNCTION CMUpdateProfileSearch(search: CMProfileSearchRef; refCon: UNIV Ptr; VAR count: UInt32): CMError;
  884.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  885.     INLINE $203C, $000C, $0028, $ABEE;
  886.     {$ENDC}
  887. PROCEDURE CMDisposeProfileSearch(search: CMProfileSearchRef);
  888.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  889.     INLINE $203C, $0004, $0029, $ABEE;
  890.     {$ENDC}
  891. FUNCTION CMSearchGetIndProfile(search: CMProfileSearchRef; index: UInt32; VAR prof: CMProfileRef): CMError;
  892.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  893.     INLINE $203C, $000C, $002A, $ABEE;
  894.     {$ENDC}
  895. FUNCTION CMSearchGetIndProfileFileSpec(search: CMProfileSearchRef; index: UInt32; VAR profileFile: FSSpec): CMError;
  896.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  897.     INLINE $203C, $000C, $002B, $ABEE;
  898.     {$ENDC}
  899. FUNCTION CMProfileIdentifierFolderSearch(ident: CMProfileIdentifierPtr; VAR matchedCount: UInt32; VAR searchResult: CMProfileSearchRef): CMError;
  900.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  901.     INLINE $203C, $000C, $003F, $ABEE;
  902.     {$ENDC}
  903. FUNCTION CMProfileIdentifierListSearch(ident: CMProfileIdentifierPtr; VAR profileList: CMProfileRef; listSize: UInt32; VAR matchedCount: UInt32; VAR matchedList: CMProfileRef): CMError;
  904.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  905.     INLINE $203C, $0014, $0040, $ABEE;
  906.     {$ENDC}
  907. FUNCTION CMIterateColorSyncFolder(proc: CMProfileIterateUPP; VAR seed: UInt32; VAR count: UInt32; refCon: UNIV Ptr): CMError;
  908.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  909.     INLINE $203C, $0010, $0058, $ABEE;
  910.     {$ENDC}
  911.  
  912. { Utilities }
  913. FUNCTION CMGetColorSyncFolderSpec(vRefNum: INTEGER; createFolder: BOOLEAN; VAR foundVRefNum: INTEGER; VAR foundDirID: LONGINT): CMError;
  914.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  915.     INLINE $203C, $000C, $0011, $ABEE;
  916.     {$ENDC}
  917. FUNCTION CMGetCWInfo(cw: CMWorldRef; VAR info: CMCWInfoRecord): CMError;
  918.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  919.     INLINE $203C, $0008, $001A, $ABEE;
  920.     {$ENDC}
  921. FUNCTION CMConvertProfile2to1(profv2: CMProfileRef; VAR profv1: CMProfileHandle): CMError;
  922.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  923.     INLINE $203C, $0008, $0045, $ABEE;
  924.     {$ENDC}
  925. FUNCTION CMGetPreferredCMM(VAR cmmType: OSType; VAR preferredCMMnotfound: BOOLEAN): CMError;
  926.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  927.     INLINE $203C, $0008, $005E, $ABEE;
  928.     {$ENDC}
  929.  
  930.  
  931. { ColorSpace conversion functions }
  932. FUNCTION CMConvertXYZToLab({CONST}VAR src: CMColor; {CONST}VAR white: CMXYZColor; VAR dst: CMColor; count: UInt32): CMError;
  933.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  934.     INLINE $203C, $0010, $004B, $ABEE;
  935.     {$ENDC}
  936. FUNCTION CMConvertLabToXYZ({CONST}VAR src: CMColor; {CONST}VAR white: CMXYZColor; VAR dst: CMColor; count: UInt32): CMError;
  937.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  938.     INLINE $203C, $0010, $004C, $ABEE;
  939.     {$ENDC}
  940. FUNCTION CMConvertXYZToLuv({CONST}VAR src: CMColor; {CONST}VAR white: CMXYZColor; VAR dst: CMColor; count: UInt32): CMError;
  941.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  942.     INLINE $203C, $0010, $004D, $ABEE;
  943.     {$ENDC}
  944. FUNCTION CMConvertLuvToXYZ({CONST}VAR src: CMColor; {CONST}VAR white: CMXYZColor; VAR dst: CMColor; count: UInt32): CMError;
  945.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  946.     INLINE $203C, $0010, $004E, $ABEE;
  947.     {$ENDC}
  948. FUNCTION CMConvertXYZToYxy({CONST}VAR src: CMColor; VAR dst: CMColor; count: UInt32): CMError;
  949.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  950.     INLINE $203C, $000C, $004F, $ABEE;
  951.     {$ENDC}
  952. FUNCTION CMConvertYxyToXYZ({CONST}VAR src: CMColor; VAR dst: CMColor; count: UInt32): CMError;
  953.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  954.     INLINE $203C, $000C, $0050, $ABEE;
  955.     {$ENDC}
  956. FUNCTION CMConvertRGBToHLS({CONST}VAR src: CMColor; VAR dst: CMColor; count: UInt32): CMError;
  957.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  958.     INLINE $203C, $000C, $0051, $ABEE;
  959.     {$ENDC}
  960. FUNCTION CMConvertHLSToRGB({CONST}VAR src: CMColor; VAR dst: CMColor; count: UInt32): CMError;
  961.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  962.     INLINE $203C, $000C, $0052, $ABEE;
  963.     {$ENDC}
  964. FUNCTION CMConvertRGBToHSV({CONST}VAR src: CMColor; VAR dst: CMColor; count: UInt32): CMError;
  965.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  966.     INLINE $203C, $000C, $0053, $ABEE;
  967.     {$ENDC}
  968. FUNCTION CMConvertHSVToRGB({CONST}VAR src: CMColor; VAR dst: CMColor; count: UInt32): CMError;
  969.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  970.     INLINE $203C, $000C, $0054, $ABEE;
  971.     {$ENDC}
  972. FUNCTION CMConvertRGBToGray({CONST}VAR src: CMColor; VAR dst: CMColor; count: UInt32): CMError;
  973.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  974.     INLINE $203C, $000C, $0055, $ABEE;
  975.     {$ENDC}
  976. FUNCTION CMConvertXYZToFixedXYZ({CONST}VAR src: CMXYZColor; VAR dst: CMFixedXYZColor; count: UInt32): CMError;
  977.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  978.     INLINE $203C, $000C, $0056, $ABEE;
  979.     {$ENDC}
  980. FUNCTION CMConvertFixedXYZToXYZ({CONST}VAR src: CMFixedXYZColor; VAR dst: CMXYZColor; count: UInt32): CMError;
  981.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  982.     INLINE $203C, $000C, $0057, $ABEE;
  983.     {$ENDC}
  984. { PS-related }
  985. FUNCTION CMGetPS2ColorSpace(srcProf: CMProfileRef; flags: UInt32; proc: CMFlattenUPP; refCon: UNIV Ptr; VAR preferredCMMnotfound: BOOLEAN): CMError;
  986.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  987.     INLINE $203C, $0014, $002E, $ABEE;
  988.     {$ENDC}
  989. FUNCTION CMGetPS2ColorRenderingIntent(srcProf: CMProfileRef; flags: UInt32; proc: CMFlattenUPP; refCon: UNIV Ptr; VAR preferredCMMnotfound: BOOLEAN): CMError;
  990.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  991.     INLINE $203C, $0014, $002F, $ABEE;
  992.     {$ENDC}
  993. FUNCTION CMGetPS2ColorRendering(srcProf: CMProfileRef; dstProf: CMProfileRef; flags: UInt32; proc: CMFlattenUPP; refCon: UNIV Ptr; VAR preferredCMMnotfound: BOOLEAN): CMError;
  994.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  995.     INLINE $203C, $0018, $0030, $ABEE;
  996.     {$ENDC}
  997. FUNCTION CMGetPS2ColorRenderingVMSize(srcProf: CMProfileRef; dstProf: CMProfileRef; VAR vmSize: UInt32; VAR preferredCMMnotfound: BOOLEAN): CMError;
  998.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  999.     INLINE $203C, $0010, $003D, $ABEE;
  1000.     {$ENDC}
  1001.  
  1002. { ColorSync 1.0 functions which have parallel 2.0 counterparts }
  1003. FUNCTION CWNewColorWorld(VAR cw: CMWorldRef; src: CMProfileHandle; dst: CMProfileHandle): CMError;
  1004.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1005.     INLINE $203C, $000C, $0000, $ABEE;
  1006.     {$ENDC}
  1007. FUNCTION ConcatenateProfiles(thru: CMProfileHandle; dst: CMProfileHandle; VAR newDst: CMProfileHandle): CMError;
  1008.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1009.     INLINE $203C, $000C, $000C, $ABEE;
  1010.     {$ENDC}
  1011. FUNCTION CMBeginMatching(src: CMProfileHandle; dst: CMProfileHandle; VAR myRef: CMMatchRef): CMError;
  1012.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1013.     INLINE $203C, $000C, $000A, $ABEE;
  1014.     {$ENDC}
  1015. PROCEDURE CMDrawMatchedPicture(myPicture: PicHandle; dst: CMProfileHandle; VAR myRect: Rect);
  1016.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1017.     INLINE $203C, $000C, $0009, $ABEE;
  1018.     {$ENDC}
  1019. FUNCTION CMUseProfileComment(profile: CMProfileHandle): CMError;
  1020.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1021.     INLINE $203C, $0004, $0008, $ABEE;
  1022.     {$ENDC}
  1023. PROCEDURE CMGetProfileName(myProfile: CMProfileHandle; VAR IStringResult: CMIString);
  1024.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1025.     INLINE $203C, $0008, $000E, $ABEE;
  1026.     {$ENDC}
  1027. FUNCTION CMGetProfileAdditionalDataOffset(myProfile: CMProfileHandle): LONGINT;
  1028.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1029.     INLINE $203C, $0004, $000F, $ABEE;
  1030.     {$ENDC}
  1031.  
  1032. { ProfileResponder functions }
  1033. FUNCTION GetProfile(deviceType: OSType; refNum: LONGINT; aProfile: CMProfileHandle; VAR returnedProfile: CMProfileHandle): CMError;
  1034.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1035.     INLINE $203C, $0010, $0005, $ABEE;
  1036.     {$ENDC}
  1037. FUNCTION SetProfile(deviceType: OSType; refNum: LONGINT; newProfile: CMProfileHandle): CMError;
  1038.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1039.     INLINE $203C, $000C, $0006, $ABEE;
  1040.     {$ENDC}
  1041. FUNCTION SetProfileDescription(deviceType: OSType; refNum: LONGINT; deviceData: LONGINT; hProfile: CMProfileHandle): CMError;
  1042.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1043.     INLINE $203C, $0010, $0010, $ABEE;
  1044.     {$ENDC}
  1045. FUNCTION GetIndexedProfile(deviceType: OSType; refNum: LONGINT; search: CMProfileSearchRecordHandle; VAR returnProfile: CMProfileHandle; VAR index: LONGINT): CMError;
  1046.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1047.     INLINE $203C, $0014, $0012, $ABEE;
  1048.     {$ENDC}
  1049. FUNCTION DeleteDeviceProfile(deviceType: OSType; refNum: LONGINT; deleteMe: CMProfileHandle): CMError;
  1050.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1051.     INLINE $203C, $000C, $0013, $ABEE;
  1052.     {$ENDC}
  1053.  
  1054. {$IFC OLDROUTINENAMES }
  1055. { constants }
  1056.  
  1057. CONST
  1058.     kMatchCMMType                = $00000001;
  1059.     kMatchApplProfileVersion    = $00000002;
  1060.     kMatchDataType                = $00000004;
  1061.     kMatchDeviceType            = $00000008;
  1062.     kMatchDeviceManufacturer    = $00000010;
  1063.     kMatchDeviceModel            = $00000020;
  1064.     kMatchDeviceAttributes        = $00000040;
  1065.     kMatchFlags                    = $00000080;
  1066.     kMatchOptions                = $00000100;
  1067.     kMatchWhite                    = $00000200;
  1068.     kMatchBlack                    = $00000400;
  1069.  
  1070. { types }
  1071.  
  1072. TYPE
  1073.     CMYKColor                            = CMCMYKColor;
  1074.     CMYKColorPtr                         = ^CMYKColor;
  1075.     CWorld                                = CMWorldRef;
  1076.     CMGamutResult                        = ^LONGINT;
  1077. { functions }
  1078. PROCEDURE EndMatching(myRef: CMMatchRef);
  1079.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1080.     INLINE $203C, $0004, $000B, $ABEE;
  1081.     {$ENDC}
  1082. PROCEDURE EnableMatching(enableIt: BOOLEAN);
  1083.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1084.     INLINE $203C, $0002, $000D, $ABEE;
  1085.     {$ENDC}
  1086. FUNCTION GetColorSyncFolderSpec(vRefNum: INTEGER; createFolder: BOOLEAN; VAR foundVRefNum: INTEGER; VAR foundDirID: LONGINT): CMError;
  1087.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1088.     INLINE $203C, $000C, $0011, $ABEE;
  1089.     {$ENDC}
  1090. FUNCTION BeginMatching(src: CMProfileHandle; dst: CMProfileHandle; VAR myRef: CMMatchRef): CMError;
  1091.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1092.     INLINE $203C, $000C, $000A, $ABEE;
  1093.     {$ENDC}
  1094. PROCEDURE DrawMatchedPicture(myPicture: PicHandle; dst: CMProfileHandle; VAR myRect: Rect);
  1095.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1096.     INLINE $203C, $000C, $0009, $ABEE;
  1097.     {$ENDC}
  1098. FUNCTION UseProfile(profile: CMProfileHandle): CMError;
  1099.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1100.     INLINE $203C, $0004, $0008, $ABEE;
  1101.     {$ENDC}
  1102. PROCEDURE GetProfileName(myProfile: CMProfileHandle; VAR IStringResult: CMIString);
  1103.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1104.     INLINE $203C, $0008, $000E, $ABEE;
  1105.     {$ENDC}
  1106. FUNCTION GetProfileAdditionalDataOffset(myProfile: CMProfileHandle): LONGINT;
  1107.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1108.     INLINE $203C, $0004, $000F, $ABEE;
  1109.     {$ENDC}
  1110. {$ENDC}  {OLDROUTINENAMES}
  1111.  
  1112.  
  1113. {  Deprecated stuff }
  1114.  
  1115. { PrGeneral parameter blocks }
  1116.  
  1117. TYPE
  1118.     TEnableColorMatchingBlkPtr = ^TEnableColorMatchingBlk;
  1119.     TEnableColorMatchingBlk = RECORD
  1120.         iOpCode:                INTEGER;
  1121.         iError:                    INTEGER;
  1122.         lReserved:                LONGINT;
  1123.         hPrint:                    THPrint;
  1124.         fEnableIt:                BOOLEAN;
  1125.         filler:                    SInt8;
  1126.     END;
  1127.  
  1128.     TRegisterProfileBlkPtr = ^TRegisterProfileBlk;
  1129.     TRegisterProfileBlk = RECORD
  1130.         iOpCode:                INTEGER;
  1131.         iError:                    INTEGER;
  1132.         lReserved:                LONGINT;
  1133.         hPrint:                    THPrint;
  1134.         fRegisterIt:            BOOLEAN;
  1135.         filler:                    SInt8;
  1136.     END;
  1137.  
  1138. {$ALIGN RESET}
  1139. {$POP}
  1140.  
  1141. {$SETC UsingIncludes := CMApplicationIncludes}
  1142.  
  1143. {$ENDC} {__CMAPPLICATION__}
  1144.  
  1145. {$IFC NOT UsingIncludes}
  1146.  END.
  1147. {$ENDC}
  1148.